<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="Yingruan" />
<meta content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1,user-scalable=0" name="viewport" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="renderer" content="webkit" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta content="telephone=no" name="format-detection" />
<meta name="apple-mobile-web-app-title" content="foodie">
<title>yhofoodie</title>
<script>
	var htphref2=window.location.href,htp2="";
	if(htphref2.indexOf("https")!=-1){
		htp2="https://"
	}else{
		htp2="http://"
	}
    document.write("<script type='text/javascript' src='"+ htp2 +"api.foodie.vc/JS_config/config.js?" + Math.random() + "'></scr" + "ipt>");
</script>
<script type='text/javascript' src='/js/jquery.js?003'></script>
<script type='text/javascript' src='/js/function.js?003'></script>
<script>	
	var lange={}
	var mainfalse=false;
    var navlange=navigator.language.toLowerCase().substr(0, 2)
	var langarr=["zh","en","ms"]
	if(langarr.indexOf(navlange)==-1) navlange="en"
    if(getCookie("language")=="null"){setCookie("language", navlange, 30);};
    document.write("<script type='text/javascript' src='/js/cacheControl.config.js?" + Math.random() + "'></scr" + "ipt>");
</script>
<script>
	//设置ajaxhead
    //delCookie("huanzhuo");
    var mem_id = getCookie("yingsoft_home_member_id");
	
	//用于微信登录获取memberID
	if(getUrlParam2("member_id")){
    	mem_id=getUrlParam2("member_id")
    }

	//清除缓存
    if(localStorage.getItem("shop_table_id")!=getUrlParam2("shop_table_id")){
    	localStorage.removeItem("cart_obj");
    	localStorage.removeItem("ver");
    }
    
    localStorage.setItem("shop_table_id",getUrlParam2("shop_table_id"))

  	mem_id == "null" ? mem_id = 0 : 0;
 
	$(function(){
		 $.ajax({
		    type: "post",
		    dataType: "json",
		    url: jsonpath + "put_member_login",
		    data: {
		        shop_id: getUrlParam2("shop_id"), shop_table_id: getUrlParam2("shop_table_id"), member_id: mem_id
		    },
		    cache: false,
		    success: function (obj) {
		    	setCookie("shopid", getUrlParam2("shop_id"), 3650);
		        $.each(obj.result, function (v, i) {
		            setCookie(v, i, 3650);
		           // localStorage.item(v,i)
		        })
		        //alert(123)
			    localStorage.setItem("setver",obj.ver);
			    window.location.href = "/main.html?r=" + Math.floor(Math.random() * 10000000)+ "#!root-html" ;
			   // start1()//加载资源
			    //Q.go("root-html");
		    },
		    error:function () {
		        alert("Loading error");
		        window.location.reload();
		    }
		});
	})
</script>
</head>
<body class="pace">

</body>

</html>
